let ModulesFile = import.meta.glob('./*.js', {eager:true});

let arr = [];

// 获取值，再用map遍历
Object.values(ModulesFile).map(el => {
    if (el.default) {
        arr.push(...el.default);
    }
});

let business = {
    path: '/business',
    name: 'Business',
    children: [
        // 重定向到index
        {path: '', redirect: '/business/index'},
        {path: 'index', component: () => import('components/business/Index.vue'), meta: {Login: true}},
        ...arr
    ]
}

export default business;